package com.smartrobot.smartrobot.pagerHolder;

import android.content.Context;
import android.os.Handler;
import android.view.View;
import android.widget.ListView;
import android.widget.TextView;

import com.smartrobot.smartrobot.R;
import com.smartrobot.smartrobot.adapter.MainMessageAdapter;

public class MessagePagerHolder1 implements BasePagerHolder{

	private View view;
    private boolean isFirst;
    private Context context;
    private TextView progressTxt;

    private ListView list;
    private MainMessageAdapter messageAdapter;

	public MessagePagerHolder1(Context context, View view) {

        this.context = context;
		this.view = view;
        this.isFirst = true;

	}

    public void initView(){


        if(isFirst){//若是第一次就初始化数据
            isFirst = false;
            new Handler().postDelayed(new Runnable() {
                @Override
                public void run() {
                    progressTxt = (TextView)view.findViewById(R.id.main_message_progress_text);

                    list = (ListView) view.findViewById(R.id.main_message_listview);
                    messageAdapter = new MainMessageAdapter(context,null);
                    list.setAdapter(messageAdapter);
                    progressTxt.setVisibility(View.GONE);

                }
            }, 500);


        }



    }



	
	@Override
	public void setView(View view) {
		this.view = view;
	}

	@Override
	public View getView() {
		return view;
	}


    class Runnable implements java.lang.Runnable{

        @Override
        public void run() {



        }
    }



}
